<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
		  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:sf="http://www.springframework.org/tags/faces"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jstl/core"
  template="/WEB-INF/layouts/templateBuyer.xhtml">


  <ui:define name="menu">

  </ui:define>

  <ui:define name="content">
    <!-- INCLUDE CONTENT -->

    <h2>Commande d'un produit</h2>
    <span class="text">Recapitulatif des informations sur le
      produit</span>
    <br />
    <br />
    <h:form>
      <h:dataTable border="2" cellpadding="4" cellspacing="4" first="0"
        rows="1" width="70%" dir="LTR" frame="border" rules="all"
        value="#{conversationScope.detailProduct}" var="dp"
        bgcolor="#F1F1F1" id="detailProduct">
        <h:column>
          <img src="#{dp['LargeImage.URL']}" alt="image" width="50%" />
        </h:column>
        <h:column valingn="top">
          <h:outputText value="ASIN: #{dp['idProduct']}" />
          <br />
          <br />
          <h:outputText value="Price: #{dp['Price']}" />
          <br />
          <br />
          <h:outputText value="Quantite: " />
          <h:inputText id="qtyOrdered" name="qtyOrdered"
            value="#{flowScope.qtyOrdered}" size="5"></h:inputText>
          <br />
          <br />
          <h:commandButton class="link" action="validateproductorder"
            value="Valider">
            <f:setPropertyActionListener
              value="#{detailProduct['idProduct']}"
              target="#{flowScope.selProduct}" />
          </h:commandButton>
          <h:outputText value="  -  " />
          <h:commandButton class="link" action="cancelproductorder"
            value="Annuler">
            <f:setPropertyActionListener
              value="#{detailProduct['idProduct']}"
              target="#{flowScope.selProduct}" />
          </h:commandButton>
          <h:outputText value="  -  " />
          <h:commandButton class="link" action="deleteproductorder"
            value="Supprimer">
            <f:setPropertyActionListener
              value="#{detailProduct['idProduct']}"
              target="#{flowScope.selProduct}" />
          </h:commandButton>
        </h:column>
      </h:dataTable>
    </h:form>
    
    <br />
    
    <h:form>
      <h:commandLink action="back">
        Back to main page
      </h:commandLink>
    </h:form>
  </ui:define>
</ui:composition>
